<template>
	<div class="Pcollect clear">
		<Pheader class="tou" msg="我的收藏"></Pheader>
		<ul class="list">
			<collect v-for="(peo,index) in list " :key = "index" :index="peo.id" :fruitImg="imgSrc[index]" 
			:fruitName="peo.name" :fruitCon="peo.detail" :fruitPrice="peo.price"></collect>
		</ul>
	</div>
</template>

<script>
	//引入头部小组件
	import Pheader from "@/components/P_header.vue";
	// 引入收藏小组件
	import collect from "@/components/collect.vue";
	
	
	export default {
		components: {
			Pheader,
			collect
		},
		data() {
			return{
				imgSrc:[],
				list:[],
			}
		},
		created() {
			var _this = this;
			this.$axios({
				method: 'post',
				url: 'http://localhost:3000/recentlook/col',
				headers: {
					'Content-Type': 'application/x-www-form-urlencoded'
				},
			}).then((response) => {
				_this.list = response.data.result;
				_this.code = response.data.code;
				for (var i = 0; i < _this.list.length; i++) {
					this.imgSrc.push(require('../assets/images/' + response.data.result[i].img));
				}
			}).catch(function(error) {
				_this.data = error;
				window.console.log(_this.data );
			});
		},
		
		
		methods: {
			
		}
	}
</script>

<style>
	.list li{
		float:left;
	}
    .Pcollect {
  width: 100%;
  /* height: 488px; */
  border: 1px solid #e7e7e7;
  /* margin-left:1%; */
  /* position: absolute;
  top: 0px;
  left: 0px; */
  background: #fff;
}
  .tou{
  padding: 12px 13px;
  border-bottom: 1px solid #e7e7e7;
}
</style>
